package com.example.asus.testskip.DGPhone;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.telephony.SmsManager;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* renamed from: dg.ca.com.DGPhone.SMSCore */
public class SMSCore {
    public static String PhoneNumber = "";

    public static String GetPhoneNumberFromSMSText(String sms) {
        for (String str : GetNumberInString(sms)) {
            if (str.length() == 11) {
                return str;
            }
        }
        return "";
    }

    public static List<String> GetNumberInString(String str) {
        List<String> list = new ArrayList<>();
        Matcher m = Pattern.compile("\\d*").matcher(str);
        while (m.find()) {
            if (!"".equals(m.group())) {
                list.add(m.group());
            }
        }
        return list;
    }

    public void SendSMS(String number, String text, Context context) {
        SmsManager.getDefault().sendTextMessage(number, null, text, PendingIntent.getActivity(context, 0, new Intent(context, context.getClass()), 0), null);
    }

    public void SendSMS2(String number, String text, Context context) {
        SmsManager.getDefault().sendTextMessage(number, null, text, PendingIntent.getActivity(context, 0, new Intent("sms_sent"), 0), PendingIntent.getActivity(context, 0, new Intent("sms_delivered"), 0));
    }
}
